package com.cyc.basic.test.rule;

import com.cyc.common.exception.ServiceException;

import java.util.Objects;

/**
 * @author chenyunchang
 * @version 1.0
 * @title
 * @date 2021/5/17 14:19
 * @Description:
 */
public class ProcessTestNew {
    public static void main(String[] args) {
        String sign = "TOUTIAO";
        ChannelRuleEnum channelRule = ChannelRuleEnum.matchRule(sign);
        if (Objects.isNull(channelRule)) {
            throw new ServiceException("400", "没有匹配上对应规则");
        }
        GeneralChannelRule rule = channelRule.channel;
        rule.process();
    }
}
